Open
Conversation
Co-authored-by: PhenX <[email protected]>
There was a problem hiding this comment.
Pull request overview
This pull request adds support for C# 14 extension members to the EntityFrameworkCore.Projectables source generator. Extension members are a new C# 14 feature that allow defining members within an extension() block, providing a more natural syntax for extending types compared to traditional extension methods.
Changes:
- Updated Microsoft.CodeAnalysis.CSharp to version 5.0.0 to support C# 14 features
- Modified the source generator to detect and process extension members using the
IsExtensionproperty - Added logic to rewrite extension parameter references (e.g.,
e) to@thisin generated expressions - Added comprehensive test coverage including generator tests and functional tests for extension member properties, methods, and methods with parameters
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Packages.props | Updated Microsoft.CodeAnalysis.CSharp from 4.11.0 to 5.0.0 |
| Directory.Build.props | Added conditional LangVersion 14.0 for net10.0 target framework |
| ProjectableInterpreter.cs | Added extension member detection and handling logic with helper methods |
| ExpressionSyntaxRewriter.cs | Added extension parameter name tracking and identifier replacement |
| ProjectionExpressionGeneratorTests.cs | Added 5 generator tests for extension member scenarios (NET10_0_OR_GREATER) |
| ExtensionMemberTests.cs | Added 2 functional tests for extension member methods |
| EntityExtensions.cs | Added extension member definitions for Entity and int types |
| Entity.cs | Added Entity class for extension member testing |
| Various .verified.txt files | Expected output verification files for all new tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/EntityFrameworkCore.Projectables.Generator/ProjectableInterpreter.cs
Show resolved
Hide resolved
src/EntityFrameworkCore.Projectables.Generator/ExpressionSyntaxRewriter.cs
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #141